home *** CD-ROM | disk | FTP | other *** search
- MENU.DOC 11/20/91 Copyright (c) 1991 by James S. Clark
- ==========================================================================
- MENU
- Menu Class
- --------------------------------------------------------------------------
- Class Name Menu
- Superclass <none>
- Category Desktop
- Other classes referenced Window
- Other catagories referenced <none>
- Used by many
- Inherited by MenuBar
- Maturity index low
-
- Declaration Menu *menu = new Menu("title", x, y,
- flags, string, color );
- Instance Variables
- Window *owner;
- int id;
- int x, y;
- int type;
- int flag;
- int width;
- int numitems;
- char key[25];
- char *itemlist;
- colors *color;
- Instance Methods
- Menu () {};
- Menu (char *title, int nx, int ny,
- int flags, char *str, colors *clr);
- int close ();
- int select ();
- --------------------------------------------------------------------------
- GENERAL DESCRIPTION
-
- The Menu Class provides a very simple way of displaying a windowed menu
- on the text screen. Methods are included to create and delete menus,
- and to allow menu item selecting. Each time select() is called, it
- returns the number of the item that was selected. Close() removes the
- menu from the screen and destroys it.
-
- --------------------------------------------------------------------------
- VARIABLES (all private)
-
- Window *owner;
- The window that the menu is located in.
-
- int id;
- The menu's ID number.
-
- int x, y;
- The upper left coordinate of the menu window.
-
- int type;
- The menu type. (0-pop-up, 1-bar)
-
- int flag;
- The menu's window flags.
-
- int width;
- The width of the menu in characters.
-
- int numitems;
- The number of items in the menu item list.
-
- char key[25];
- The hot key letter of the menu items (maximum of 25)
-
- char *itemlist;
- The formatted menu item string.
-
- colors *color;
- The color set used to drae the menu.
-
- --------------------------------------------------------------------------
- METHODS
-
- Menu (char *title, int nx, int ny, int flags, char *str, colors *clr);
- Creates a new menu and displays it on the screen. The formatted
- menu string contains '>' signs at the head of each item. The
- menu is automatically size to accomidate the items specified.
-
- ~Menu ();
- This closes the menu and removes it from the screen.
-
- int close ();
- This closes the menu and removes it from the screen.
-
- int select ();
- This allows the user to make a selection from the menu, using the
- arrow keys to position, the enter key to select, or the escape key
- to abort. Returns with the item number selected or -1 for abort.
-
- --------------------------------------------------------------------------
- MENU.DOC Copyright (c) 1991 by James S. Clark
- ==========================================================================
-